<html DIR="LTR" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:tool="http://www.microsoft.com/tooltip"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=Windows-1252"></META><META NAME="save" CONTENT="history"></META><title>Applying Unix Filesystem Attributes to Files under Version Control</title><STYLE TYPE="text/css">
    body
    {
        background:    #FFFFFF;
        color: #000000;
        font-family:    Verdana;
        font-size: medium;
        font-style: normal;
        font-weight: normal;
        margin-top:    0;
        margin-bottom:    0;
        margin-left:    0;
        margin-right:    0;
        width:    100%;
    }
    
    a
    {
        color:    #0000FF;
    }
    
    a:visited
    {
        color:    #0000FF;
    }
    
    a:link
    {
        color:    #0000FF;
    }
    
    a:hover
    {
        color:    #FF0000;
        cursor: hand;
    }
    
    a:active
    {
        color:    #FF0000;
        cursor: hand;
    }
    
    div#mainSection
    {
        font-size: 70%;
        width: 100%;
    }
    
    div#mainBody
    {
        font-size: 90%;
        margin-left:    5;
        margin-top: 10;
        padding-bottom: 20;
    }
    
    div#header
    {
        background-color: #D4DFFF;
        padding-top:    0;
        padding-bottom:    0;
        padding-left:    0;
        padding-right:    0;
        width:    100%;
    }
    
    div#header table
    {
        border-bottom-color: #C8CDDE;
        border-bottom-style: solid;
        border-bottom-width: 1;
        width:    100%;
    }
    
    span#runningHeaderText
    {
        color: #003399;
        font-size: 90%;
    }
    
    span#nsrTitle
    {
        color: #003399;
        font-size: 125%;
        font-weight: 600;
    }
    
    div#header table td
    {
        color: #0000FF;
        font-size: 70%;
        margin-top:    0;
        margin-bottom:    0;
        padding-right: 20;
    }
    
    div#header table tr#headerTableRow3 td
    {
        padding-bottom: 2;
        padding-top: 5;
    }
    
    div#header table#bottomTable
    {
        border-top-color: #FFFFFF;
        border-top-style: solid;
        border-top-width: 1;
        text-align: left;
    }
    
    div#footer
    {
        font-size: 90%;
        margin-top:    0;
        margin-bottom:    0;
        margin-left:    0;
        margin-right:    0;
        padding-top:    2;
        padding-bottom:    2;
        padding-left:    2;
        padding-right:    2;
        width:    100%;
    }
    
    hr#footerHR
    {
        border-bottom-color: #EEEEFF;
        border-bottom-style: solid;
        border-bottom-width: 1;
        border-top-color: C8CDDE;
        border-top-style: solid;
        border-top-width: 1;
        height: 3;
        color: #D4DFFF;
    }
    
    div.section
    {
        padding-top:    2;
        padding-bottom:    2;
        padding-left:    16;
        padding-right:    15;
        width:    100%;
    }
    
    .heading
    {
        font-weight:    bold;
        margin-top:        18;
        margin-bottom:    8;
    }
    
    h1.heading
    {
        color: #003399;
        font-size:    125%;
    }
    
    .subHeading
    {
        font-weight:    bold;
        margin-bottom:    4;
    }
    
    h3.subHeading
    {
        color:  #003399;
        font-size: 115%;
        font-weight: bold;
    }
    
    h4.subHeading
    {
        color: #003399;
        font-size: 105%;
    }
    
    h5.subHeading
    {
        color: #003399;
        font-size: 100%;
    }
    
    img.toggle
    {
    	border: 0;
	margin-right: 5;
    }

    img.copyCodeImage
    {
	border: 0;
	margin-right: 3;
    }

    img.downloadCodeImage
    {
	border: 0;
	margin-right: 3;
    }

    img.viewCodeImage
    {
	border: 0;
	margin-right: 3;
    }

    img.note
    {
	border: 0;
	margin-right: 3;
    }

    img#languageFilterImage
    {
	border: 0;
	margin-left: 10;
	vertical-align: middle;
    }

    img#membersOptionsFilterImage
    {
	border: 0;
	margin-left: 10;
	vertical-align: middle;
    }

    img#toggleAllImage
    {
	margin-left: 4;
	vertical-align: middle;
    }
    
    div#mainSection table
    {
        border: 0;
        font-size: 100%;
        width:    100%;
    }
    
    div#mainSection table th
    {
        background:    #EFEFF7;
        border-bottom-color: #C8CDDE;
        border-bottom-style: solid;
        border-bottom-width: 1;
        color: #000066;
        padding-left: 5;
        padding-right: 5;
    }
    
    div#mainSection table td
    {
        background:    #F7F7FF;
        border-top-color: #FFFFFF;
        border-top-style: solid;
        border-top-width: 1;
        padding-left: 5;
        padding-right: 5;
    }
    
    div#mainSection table td.imageCell
    {
        white-space: nowrap;
    }
    
    div.code table
    {
        border: 0;
        font-size: 95%;
        margin-bottom: 5;
        width: 100%
    }
    
    div.code table th
    {    
        background:    #EFEFF7;
        border-bottom-color: #C8CDDE;
        border-bottom-style: solid;
        border-bottom-width: 1;
        color: #000066;
        font-weight: bold;
        padding-left: 5;
        padding-right: 5;
    }
    
    div.code table td
    {
        background:    #F7F7FF;
        border-top-color: #FFFFFF;
        border-top-style: solid;
        border-top-width: 1;
        padding-left: 5;
        padding-right: 5;
        padding-top: 5;
    }
    
    div.alert table
    {
        border: 0;
        font-size: 100%;
        width:    100%;
    }
    
    div.alert table th
    {
        background:    #EFEFF7;
        border-bottom-width: 0;
        color: #000066;
        padding-left: 5;
        padding-right: 5;
    }
    
    div.alert table td
    {
        background:    #F7F7FF;
        border-top-color: #FFFFFF;
        border-top-style: solid;
        border-top-width: 1;
        padding-left: 5;
        padding-right: 5;
    }
    
    .copyCode
    {
        color: #0000ff;
        font-size: 90%;
        font-weight: normal;
    }
    
    .downloadCode
    {
        color: #0000ff;
        font-size: 90%;
        font-weight: normal;
    }
    
    .viewCode
    {
        color: #0000ff;
        font-size: 90%;
        font-weight: normal;
    }
    
    div.code pre
    {
        font-family:    Monospace, Courier New, Courier;
        font-size: 105%;
        color:    #000066;
        word-wrap:    break-word;
    }
    
    code
    {
        font-family:    Monospace, Courier New, Courier;
        font-size: 105%;
        color:    #000066;
    }
    
    dl
    {
        margin-top:    0;
        padding-left:    1;
    }
    
    dt
    {
        font-style:    italic;
    }
    
    dd
    {
        margin-bottom:    0;
        margin-left:    0;
    }
    
    ul
    {
        margin-left: 17;
        list-style-type: disc;
    }
    
    ul ul
    {
        margin-bottom: 4;
        margin-left: 17;
        margin-top: 3;
        list-style-type: disc;
    }
    
    ol
    {
        margin-left: 24;
        list-style-type: decimal;
    }
    
    ol ol
    {
        margin-bottom: 4;
        margin-left: 24;
        margin-top: 3;
        list-style-type: lower-alpha;
    }
    
    li
    {
        margin-bottom: 3;
    }
    
    p
    {
        margin-top: 0;
        margin-bottom: 15;
    }
    
    .tip
    {
        color:    #0000FF;
        font-style: italic;
        cursor:hand;
        text-decoration:underline;
    }
    
    .languageFilter
    {
        color:    #0000FF;
        cursor:hand;
        text-decoration:underline;
        padding-bottom:4;
    }
    
    .math
    {
        font-family: Times New Roman;
        font-size: 125%
    }
    
    .sourceCodeList
    {
        font-family: Verdana;
        font-size: 90%;    
    }
    
    pre.viewCode
    {
        width: 100%;
        overflow: auto;
    }
    
    MSHelp\:link
    {
        text-decoration: underline;
        color: #0000ff; 
        hoverColor: #3366ff;
        filterString: ;
    }
</STYLE>
</head>
<body><input type="hidden" id="userDataCache" class="userDataStyle"></input><input type="hidden" id="hiddenScrollOffset"></input><img id="dropDownImage" style="display:none; height:0; width:0;" src="drpdown.gif"><img id="dropDownHoverImage" style="display:none; height:0; width:0;" src="drpdown_orange.gif"><img id="collapseImage" style="display:none; height:0; width:0;" src="collapse.gif"><img id="expandImage" style="display:none; height:0; width:0;" src="exp.gif"><img id="copyImage" style="display:none; height:0; width:0;" src="copycode.gif"><img id="copyHoverImage" style="display:none; height:0; width:0;" src="copycodeHighlight.gif"><div id="header"><table width="100%" id="topTable"><tr id="headerTableRow1"><td align="left"><span id="runningHeaderText"></span></td></tr><tr id="headerTableRow2"><td align="left"><span id="nsrTitle">Applying Unix Filesystem Attributes to Files under Version Control</span></td></tr><tr id="headerTableRow3"></tr></table></div><div id="mainSection"><div id="mainBody"><div id="allHistory" class="saveHistory"></div>
				<p>If you work with Eclipse on a computer that is running Unix, you might want to store Unix file system attributes with files that you check in to version control. For example, you might want to specify that a file in version control be made executable when it is retrieved from version control. Visual Studio Team Foundation Server
 does not provide a means to store this information with the file that is added to version control. However, you can specify a file that is named .tpattributes in any working folder. If that file exists when you retrieve files from version control, the contents of that file specify which attributes should be set on files in that folder. </p>
				<p>You can add the .tpattributes file to version control. When any team member retrieves that file to their working folder, Team Explorer Everywhere will set attributes based the contents of the file. If the .tpattributes file is deleted from disk, subsequent <b>get</b> operations on files in that directory will cause their attributes to revert to their default states. Attributes also revert to their default states for files whose .tpattributes lines are removed or are made into comments.</p>
			<h1 class="heading">Format of the .tpattributes File</h1><div id="sectionSection0" class="section"><content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
					<p xmlns="">The .tpattributes file is a text file with a simple format. You must create this file manually.</p>
				</content><sections xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
					<h3 class="subHeading" xmlns="">Backus-Naur Form (BNF)</h3><div class="subSection" xmlns=""><content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
							<p xmlns="">The syntax of the .tpattributes file, as represented in BNF, is as follows:</p>
							<div class="code" xmlns=""><span codeLanguage="other"><table width="100%" cellspacing="0" cellpadding="0"><tr><th align="left"></th><th align="right"><span class="copyCode" onclick="CopyCode(this)" onkeypress="CopyCode_CheckKey(this)" style="cursor:default;" onmouseover="ChangeCopyCodeIcon(this)" onfocusin="ChangeCopyCodeIcon(this)" onmouseout="ChangeCopyCodeIcon(this)" onfocusout="ChangeCopyCodeIcon(this)" tabindex="0"></span></th></tr><tr><td colspan="2"><pre>    &lt;.tpattributes&gt;         ::= { &lt;line&gt; }
    &lt;line&gt;                  ::= &lt;comment-line&gt; | &lt;directive-line&gt; &lt;EOL&gt;
    &lt;comment-line&gt;          ::= "#" &lt;ignored-text&gt;
    &lt;directive-line&gt;        ::= &lt;file-expression&gt; ":" &lt;attribute&gt; { "|" &lt;attribute&gt; }
    &lt;attribute&gt;             ::= &lt;boolean-attribute&gt; | &lt;string-pair-attribute&gt;
    &lt;string-pair-attribute&gt; ::= &lt;key&gt; "=" &lt;value&gt;
</pre></td></tr></table></span></div>
							<p xmlns="">Most whitespace is ignored when Team Explorer Everywhere parses this file. Leading and trailing whitespace is ignored when parsing &lt;line&gt;, &lt;file-expression&gt;, &lt;boolean-attribute&gt;, &lt;key&gt;, and &lt;value&gt;. Malformed lines are ignored. Unknown attributes are also ignored and other recognized attributes are still applied.</p>
							<p xmlns="">
								<b>Example .tpattributes file</b>
							</p>
							<div class="code" xmlns=""><span codeLanguage="other"><table width="100%" cellspacing="0" cellpadding="0"><tr><th align="left"></th><th align="right"><span class="copyCode" onclick="CopyCode(this)" onkeypress="CopyCode_CheckKey(this)" style="cursor:default;" onmouseover="ChangeCopyCodeIcon(this)" onfocusin="ChangeCopyCodeIcon(this)" onmouseout="ChangeCopyCodeIcon(this)" onfocusout="ChangeCopyCodeIcon(this)" tabindex="0"></span></th></tr><tr><td colspan="2"><pre>    # Lines that begin with #, like this one, are ignored.
    build.sh:x
    README.txt:y|z=m
    include:link=$/Project/include
    docs:link=../extras/docs
    # The following line makes all Perl files executable.
    .*\.pl:x
    # The following line matches both "cleanzpl" as well as "clean.pl" and sets both the x and u attributes.
    clean.pl:x|u
</pre></td></tr></table></span></div>
							<p xmlns="">The first field of a non-comment line is a file name or regular expression, without any leading path information. This file name or expression refers to a file or directory in the same directory where the .tpattributes file exists. The file name is ended by a colon (which Team Foundation Server
 does not allow in its file paths and is not a special regular expression character). The part after the colon is a list of attributes, all of which apply to the named item, delimited by a pipe character (|). An attribute is either a string pair attribute (for example, "link=$/Project/include") or a boolean attribute (for example, "x").</p>
						</content></div>
					<h3 class="subHeading" xmlns="">Supported Attributes</h3><div class="subSection" xmlns=""><content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
							<p xmlns="">
								Team Explorer Everywhere supports the following attributes in the .tpattributes file. The descriptions for each attribute specify which attributes can be combined.</p>
						</content><sections xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
							<h4 class="subHeading" xmlns="">x</h4><div class="subSection" xmlns=""><content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
									<p xmlns="">This attribute represents a boolean value that specifies that the named file will be made executable after it is written to disk. This attribute is supported by Team Explorer Everywhere only on computers that are running Unix (this includes Mac OS X) and cannot be applied to directories. Team Explorer Everywhere will turn on the execute bits according to the umask for that user. The <b>x</b> attribute may generally be combined with other attributes (some exceptions apply).</p>
									<p xmlns="">When multiple files are matched by a regular expression, the executable attribute is applied to all files.</p>
								</content></div>
							<h4 class="subHeading" xmlns="">link=&lt;path&gt;</h4><div class="subSection" xmlns=""><content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
									<p xmlns="">This attribute consists of a string pair and specifies that a symbolic link should be created in place of the file name that was specified on this directive line. This file must exist in version control for a link to be created. The contents of the file are ignored if a link is to be created in its place.</p>
									<p xmlns="">The value of the <b>link</b> attribute is the relative or absolute path of a server that is running Team Foundation Server
, and this path specifies where the symbolic link should point. Before Team Explorer Everywhere will create a symbolic link, it verifies whether the link destination is mapped to a working folder in the current Team Foundation Server
 workspace. If so, the link is created to point to the item on disk. If the destination is not mapped, the symbolic link is not created because Team Explorer Everywhere cannot determine the target of the link. When this occurs, the file contents from Team Foundation Server
 are put on disk instead.</p>
									<p xmlns="">When multiple files are matched by a regular expression, each file is created as a link to the link value.</p>
								</content></div>
							<h4 class="subHeading" xmlns="">local-link=&lt;path&gt;</h4><div class="subSection" xmlns=""><content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
									<p xmlns="">This attribute consists of a string pair that specifies that a symbolic link should be created in place of the file name specified on this directive line. This file must exist in version control for a link to be created. The contents of the file are ignored if a link is to be created in its place.</p>
									<p xmlns="">The value of the <b>local-link</b> attribute is a literal local path that specifies the target of the symbolic link. The local path is not interpreted by either client for Team Explorer Everywhere. The local path is given to the operating system and can be any path style (relative or absolute) that is accepted by the <b>symlink</b> function of the operating system.</p>
									<p xmlns="">When multiple files are matched by a regular expression, each file is created as a link to the link value.</p>
									<p xmlns="">The <b>local-link</b> attribute overrides the <b>link</b> attribute if both are specified for a file. For example, if <b>link</b> is applied to a regular expression matching all .txt files (".*\.txt"), but <b>local-link</b> is applied for file.txt, a local link is created for file.txt.</p>
								</content></div>
							<h4 class="subHeading" xmlns="">client-eol=&lt;eol-style&gt;</h4><div class="subSection" xmlns=""><content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
									<p xmlns="">This attribute consists of a string pair that enables automatic conversion of line endings to the named style when a file is written to a working folder during a <b>get</b> operation. A file can have one or both of the <b>client-eol</b> and <b>server-eol</b> attributes set for it. When this attribute is set for a file, all line styles of line endings are converted to the named style.</p>
									<div class="alert" xmlns=""><table width="100%" cellspacing="0" cellpadding="0"><tr><th align="left">Caution </th></tr><tr><td>
										You must set this attribute only for text files in encodings that are supported by your Java runtime. If you set this attribute for non-text files, the contents of the files might be corrupted.<p></p>
									</td></tr></table><p></p></div>
									<p xmlns="">The value of the <b>client-eol</b> attribute is one of the following end-of-line styles:</p>
									<h3 class="subHeading" xmlns=""></h3><table xmlns=""><tr>
												<th>
													eol-style
												</th>
												<th>
													Newline sequence used
												</th>
											</tr><tr>
											<td>
												<p>lf</p>
											</td>
											<td>
												<p>Unicode U+000A, used on Unix operating systems including Mac OS X</p>
											</td>
										</tr><tr>
											<td>
												<p>crlf</p>
											</td>
											<td>
												<p>Unicode U+000D,U+000A, used on Windows operating systems</p>
											</td>
										</tr><tr>
											<td>
												<p>cr</p>
											</td>
											<td>
												<p>Unicode U+000D, used on older Mac OS operating systems (System 9 and previous)</p>
											</td>
										</tr><tr>
											<td>
												<p>native</p>
											</td>
											<td>
												<p>The default style used on the operating system of the computer where you run either client for Team Explorer Everywhere</p>
											</td>
										</tr></table>
									<p xmlns="">
										<b>Examples</b>
									</p>
									<div class="code" xmlns=""><span codeLanguage="other"><table width="100%" cellspacing="0" cellpadding="0"><tr><th align="left"></th><th align="right"><span class="copyCode" onclick="CopyCode(this)" onkeypress="CopyCode_CheckKey(this)" style="cursor:default;" onmouseover="ChangeCopyCodeIcon(this)" onfocusin="ChangeCopyCodeIcon(this)" onmouseout="ChangeCopyCodeIcon(this)" onfocusout="ChangeCopyCodeIcon(this)" tabindex="0"></span></th></tr><tr><td colspan="2"><pre>Makefile: client-eol=native
build.sh: x | client-eol=lf</pre></td></tr></table></span></div>
								</content></div>
							<h4 class="subHeading" xmlns="">server-eol=&lt;eol-style&gt;</h4><div class="subSection" xmlns=""><content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
									<p xmlns="">This attribute consists of a string pair that enables automatic conversion of line endings to the named style when a file is sent to the server for a check-in or shelve operation. A file can have one or both of the <b>client-eol</b> and <b>server-eol</b> attributes set for it. When this attribute is set for a file, all line styles of line endings are converted to the named style.</p>
									<div class="alert" xmlns=""><table width="100%" cellspacing="0" cellpadding="0"><tr><th align="left">Caution </th></tr><tr><td>
										You must set this attribute only for text files in encodings that are supported by your Java runtime. If you set this attribute for non-text files, the contents of the files might be corrupted.<p></p>
									</td></tr></table><p></p></div>
									<p xmlns="">The value of the <b>server-eol</b> attribute is one of the end-of-line styles as described in the previous table for the <b>client-eol</b> attribute.:</p>
									<p xmlns="">
										<b>Examples</b>
									</p>
									<div class="code" xmlns=""><span codeLanguage="other"><table width="100%" cellspacing="0" cellpadding="0"><tr><th align="left"></th><th align="right"><span class="copyCode" onclick="CopyCode(this)" onkeypress="CopyCode_CheckKey(this)" style="cursor:default;" onmouseover="ChangeCopyCodeIcon(this)" onfocusin="ChangeCopyCodeIcon(this)" onmouseout="ChangeCopyCodeIcon(this)" onfocusout="ChangeCopyCodeIcon(this)" tabindex="0"></span></th></tr><tr><td colspan="2"><pre>win32-module.c: client-eol=native | server-eol=crlf
Makefile.MacOS9: server-eol=cr</pre></td></tr></table></span></div>
								</content></div>
							<h4 class="subHeading" xmlns="">transform=&lt;format&gt;</h4><div class="subSection" xmlns=""><content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
									<p xmlns="">This attribute consists of a string pair that enables automatic conversion from a native file format on the client into a different format on the instance of Team Foundation Server
. The file is transformed when it is sent to the server for a check-in or shelve operation, and is transformed into its native format when it is retrieved from the server by a <b>get</b> operation.</p>
									<p xmlns="">The value of the <b>transform</b> attribute is one of the following encoding techniques:</p>
									<h3 class="subHeading" xmlns=""></h3><table xmlns=""><tr>
												<th>
													Transform
												</th>
												<th>
													Encoding used
												</th>
											</tr><tr>
											<td>
												<p>apple</p>
											</td>
											<td>
												<p>This causes Mac OS-specific metadata to be preserved in a file on the local filesystem, including the resource fork, Finder info, and Finder comments. Without this attribute, resource forks will not be checked in to Team Foundation Server
.</p>
												<div class="alert"><table width="100%" cellspacing="0" cellpadding="0"><tr><th align="left">Note </th></tr><tr><td>
													This attribute value is supported for Team Explorer Everywhere clients only on computers that are running the Mac OS X operating system. On other operating systems, this value is ignored.<p></p>
												</td></tr></table><p></p></div>
											</td>
										</tr></table>
									<p xmlns="">
										<b>Examples</b>
									</p>
									<div class="code" xmlns=""><span codeLanguage="other"><table width="100%" cellspacing="0" cellpadding="0"><tr><th align="left"></th><th align="right"><span class="copyCode" onclick="CopyCode(this)" onkeypress="CopyCode_CheckKey(this)" style="cursor:default;" onmouseover="ChangeCopyCodeIcon(this)" onfocusin="ChangeCopyCodeIcon(this)" onmouseout="ChangeCopyCodeIcon(this)" onfocusout="ChangeCopyCodeIcon(this)" tabindex="0"></span></th></tr><tr><td colspan="2"><pre>MacOS9Application: x | transform=apple</pre></td></tr></table></span></div>
								</content></div>
						</sections></div>
				</sections></div><h1 class="heading"><span id="seeAlsoNoToggle">See Also</span></h1><div id="seeAlsoSection" class="section"><h4 class="subHeading">Concepts</h4><a href="putundervc.htm" target="_blank">Placing Files under Version Control</a><br /><a href="tpignore.htm" target="_blank">Excluding Eclipse Project Resources from Version Control</a><br /><br /></div><!--[if gte IE 5]>
			<tool:tip element="seeAlsoToolTip" avoidmouse="false"/><tool:tip element="languageFilterToolTip" avoidmouse="false"/>
		<![endif]--></div><div id="footer"><hr /><p /></div></div></body></html>